package com.koala.learn.json;

import cn.hutool.db.Page;
import com.alibaba.fastjson.JSON;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Collection;

/**
 * @author xihuanjin
 * @version 1.0
 * @date 2022/4/26 14:08
 */
@Data
@Accessors(chain = true)
public class BdCheckInRecordQueryDTO extends Page implements Serializable {

    private static final long serialVersionUID = 5713897629039295414L;

    private Collection<Long> ids;

    private Collection<String> merchantNos;

    private Collection<String> accountNos;

    /**
     * 拜访时间
     */
    private Collection<String> visitTime;

    private Collection<String> createTime;


    private String phone;

    private String idCardNo;

    private Integer status;

    /**
     * 签到 or 拜访
     */
    private Integer action;

    /**
     * 区别于下面数据库权限的orgIds
     */
    private Collection<Integer> orgs;
    /**
     * 分公司id列表
     */
    private Collection<Integer> orgIds;

    /**
     * 一级编号列表
     */
    private Collection<String> mallIds;

    public static void main(String[] args) {
        String s2 = "{\"page\":1,\"size\":10,\"visitTime\":[\"2022-08-10 00:00:00\",\"2022-09-29 23:59:59\"]}";
        //String s2 = "{\"createTime\":[\"2022-04-01 00:00:00\",\"2022-04-29 23:59:59\"],\"page\":1,\"size\":20}";
        //String s = "{\"page\":1,\"size\":10}";
        if (JSON.isValid(s2)) {
            BdCheckInRecordQueryDTO params = JSON.parseObject(s2, BdCheckInRecordQueryDTO.class);
            System.out.println(JSON.toJSONString(params));
        }
    }

}
